﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.LanguageExtensions
{
	public static class IEnumerableExtensions
	{
		/// <summary>
		/// Applies a particular action to all elements of an IEnumerable
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="enumerable"></param>
		/// <param name="action"></param>
		public static void Apply<T>(this IEnumerable<T> enumerable, Action<T> action)
		{
			foreach (T t in enumerable)
			{
				action(t);
			}
		}
	}
}